passthrough: share_p2m: fix build failure on ARM
authorJulien Grall <julien.grall@linaro.org>
Wed, 11 Mar 2015 13:05:25 +0000 (14:05 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 11 Mar 2015 13:05:25 +0000 (14:05 +0100)
commit9bac5f5ccd8920d6a0ed624d54880677b10dc1a7
tree9de16d8a3d01b89db62c895700ba190c8fd0d85f
parentd6ccfe6ba053159b0e9c14850de2c5e6a703208c
passthrough: share_p2m: fix build failure on ARM

The commit 7978429 "iommu: fix usage of shared EPT/IOMMU page tables on
PVH guests" breaks the hypervisor compilation on ARM.

This is because the macro hap_enabled is not defined on ARM.

On x86, the P2M can only be shared when hap is enabled and the user
didn't deny it (via the command line). Those checks are done by
iommu_use_hap_pt().

On ARM, the macro iommu_use_hap_pt() is also defined. So move the
if ( iommu_use_hap_pt(d) ) from the IOMMU drivers up to
iommu_share_p2m_table.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
xen/drivers/passthrough/amd/iommu_map.c
xen/drivers/passthrough/iommu.c
xen/drivers/passthrough/vtd/iommu.c